<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>
        <h1>我是A页面</h1>
    </div>
    <button>点击我跳转到B页面</button>
    <script>
        var btnEle1 = document.querySelector("button");
        btnEle1.onclick = function () {
            var num1 = 10 ; 
            var num2 = 20 ; 
            window.location.href = `./demo4.1跨页面传参.html?num1=${num1}&num2=${num2}`
        }
    </script>
</body>
</html>